var _mm = require('util/mm.js');

var _user = {
	//退出
	logout: function() {
		return _mm.request({
			url: _mm.getServerUrl('/user/logout.do'),
			type: "POST"
		});
	},
	checkLogin:function(){
		return _mm.request({
			url: _mm.getServerUrl('/user/get_user_info.do'),
			type: "POST"
		});	
	},
	logIn:function(userInfo){
		return _mm.request({
			url: _mm.getServerUrl('/user/login.do'),
			data    : userInfo,
			type: "POST"
		});	
	},
	register:function(userInfo){
		return _mm.request({
			url: _mm.getServerUrl('/user/register.do'),
			data    : userInfo,
			type: "POST"
		});	
	},
	checkUserName:function(username){
		return _mm.request({
			url: _mm.getServerUrl('/user/check_valid.do'),
			data    : {
				type    : 'username',
                str     : username
			},
			type: "POST"
		});	
	},
}

module.exports = _user;

